package com.example.demo.service.impl;

import com.example.demo.pojo.mysqlPojo.myUser;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.text.ParseException;
import java.text.SimpleDateFormat;

@RunWith(SpringRunner.class)
@SpringBootTest
public class testuserService {
    @Autowired
    private userServiceImpl userService;
    @Autowired
    private redisServiceImpl redisService;

    @Test
    public void userServiceTest(){
//        Date date=sdf.parse("1956-11-22");
////        myuser.setBirthday(sdf.parse("1956-11-22"));
        int i=userService.delete(3);
    }

    @Test
    public void insertUserTest() throws ParseException {
        SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd");
        myUser myuser=new myUser();
        myuser.setUsername("王五");
        myuser.setPassword("123123");
        myuser.setBirthday(sdf.parse("1977-11-22"));
        redisService.insertUser(myuser);
    }
}
